home *** CD-ROM | disk | FTP | other *** search
/ Aminet 41 / Aminet 41 (2001)(Schatztruhe)[!][Feb 2001].iso / Aminet / comm / net / tf02.lha / TinyFugue / tf-lib / psh.tf < prev    next >
Text File  |  1995-08-12  |  583b  |  18 lines

  1. ;;; preferred shell
  2. ;; /psh [<command>]
  3. ;; Like /sh, but uses ${SHELL} instead of /bin/sh to execute <command>.
  4. ;; bug:  barfs on suspend (^Z) because SHELL is really a child of /bin/sh,
  5. ;; which doesn't have job control.  Workaround:  don't ^Z during /psh.
  6.  
  7. /~loaded pref-shell.tf
  8.  
  9. /def -i psh = \
  10.     /if ( ({#} > 0) & (SHELL !~ "") & (SHELL !~ "/bin/sh") ) \
  11.         /setenv ARGS=%*%;\
  12.         /def -i -hSHELL -1 -agG ~psh_hook = \
  13.             /echo %% Executing %{SHELL} command: %%{ARGS}%;\
  14.         /@sh exec %{SHELL} -i -c "$$ARGS"%;\
  15.     /else \
  16.         /@sh %*%;\
  17.     /endif
  18.